/**
  ******************************************************************************
  * @author     Chris
  * @since      2024/6/26 23:00
  *
  * @file       pd_rtc.h
  * @brief      Header file of Xxx hardware driver.
  *
  * @note       This file contains the Xxx object declaration.
  *
  * @warning    None.
  ******************************************************************************
  * Change Logs:
  *   Date          Author       Notes
  *   2024/6/26     Chris        the first version
  *
  ******************************************************************************
  */


#ifndef JLC_SKY_RTC_H
#define JLC_SKY_RTC_H

#include "stm32f407xx.h"
#include "drivers.h"

typedef struct RealTimeClockDef RealTimeClock;

struct RealTimeClockDef {

    void (*init)(RealTimeClock *this);

    void (*set_datetime)(RealTimeClock *this);

    void (*read_time)(RealTimeClock *this);

    uint32_t (*get_time )(RealTimeClock *this);

    uint32_t (*get_date )(RealTimeClock *this);
};

extern const struct RealTimeClockClass {
    RealTimeClock *(*build)();
} RTCBuilder;

#define YEAR    0
#define MONTH   1
#define DAY     2
#define HOUR    3
#define MINUTE  4
#define SECOND  5
#define WEEK    6

#endif //JLC_SKY_RTC_H
